package org.devops

//获取部署主机,获取部署playbook文件
def AnsibleDeploy(deployHost,playbookHome){
    ansiblePlaybook (
        colorized: true,
        extras: "-e hosts=${deployHost}",
        installation: 'ansible-playbook',
        playbook: "${playbookHome}"
    )
}

//获取主机列表
def AnsibleList(instance){
    process = sh (script: "ansible ${instance} --list|grep -v 'hosts'| xargs",returnStdout:true)
    return process
}

